package com.jxw.constant;

import android.net.Uri;
import android.util.Log;
import com.jxw.launcher.BuildConfig;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

/* loaded from: classes.dex */
public class Constant {
    public static final String CHECKED = "checked";
    public static final String DATE = "date";
    public static final String DOMAIN3 = "http://api4.jiumentongbu.com";
    public static final String DOMAIN3_OFFICIAL = "http://api4.jiumentongbu.com/api/jwfd/baseapp/url?filePath=专区数据/";
    public static final String ID = "_id";
    public static final String JSON_SUFFIX = "menu.json";
    public static final String MODULE = "module";
    public static final String MODUL_ACTIVITY_DURATION = "modul_activity_duration";
    public static final String MODUL_ENTER_TIME = "modul_enter_time";
    public static final String MODUL_EXIT_TIME = "modul_exit_time";
    public static final String MODUL_NAME = "modul_name";
    public static final String MODUL_TYPE = "modul_type";
    public static String PLATFORM_URL_HEADER = null;
    public static final String QUANXIAN_INFO_TABLE = "quanxian_info_table";
    public static String REGISTER_URL_HEADER = null;
    public static final String SETNAME = "setname";
    public static String SIGN_KEY = null;
    public static final String TIME = "time";
    public static final Uri STUDY_RECENTLY_URI = Uri.parse("content://com.jxw.studydiagnose.MyUriMatcher/testRecord");
    public static final Uri STUDY_RECORDR_URI = Uri.parse("content://com.jxw.studyrecord.provider/studyrecorder");
    private static String PLATFORM_VERSION = "";

    private static String getPlatFormUrl() {
        return null;
    }

    static {
        setPlatFormType();
    }

    public static void setPlatFormType() {
        try {
            PLATFORM_VERSION = readFileContent(new FileInputStream(new File("/sdcard/config.ini")));
            setPlatform();
        } catch (IOException e) {
            setPlatform();
            e.printStackTrace();
        }
    }

    private static void setPlatform() {
        Log.i("zzj", "zzj the PlatFormType=" + PLATFORM_VERSION);
        if ("test".equals(PLATFORM_VERSION)) {
            PLATFORM_URL_HEADER = "http://api3.test.jiumentongbu.com";
            REGISTER_URL_HEADER = "http://sync.debug.jiumentongbu.com";
            SIGN_KEY = "YxCcUzDWRz1HVkj1Xtofkilb5KrnJAxs";
        } else if ("gray".equals(PLATFORM_VERSION)) {
            PLATFORM_URL_HEADER = "https://gw.pre.xuexizhiwang.com";
            REGISTER_URL_HEADER = BuildConfig.SYNC_HOST;
            SIGN_KEY = "PZbKVKQUavLmswFznRnuACg9u2o8pmhL";
        } else {
            PLATFORM_URL_HEADER = "https://apipad.xuexizhiwang.com";
            REGISTER_URL_HEADER = BuildConfig.SYNC_HOST;
            SIGN_KEY = "PZbKVKQUavLmswFznRnuACg9u2o8pmhL";
        }
    }

    private static String readFileContent(InputStream inputStream) {
        BufferedReader bufferedReader;
        InputStreamReader inputStreamReader = new InputStreamReader(inputStream);
        StringBuffer stringBuffer = new StringBuffer();
        BufferedReader bufferedReader2 = null;
        try {
            try {
                bufferedReader = new BufferedReader(inputStreamReader);
                while (true) {
                    try {
                        String readLine = bufferedReader.readLine();
                        if (readLine == null) {
                            break;
                        }
                        stringBuffer.append(readLine);
                    } catch (IOException e) {
                        e = e;
                        bufferedReader2 = bufferedReader;
                        e.printStackTrace();
                        if (bufferedReader2 != null) {
                            try {
                                bufferedReader2.close();
                            } catch (IOException e2) {
                                e2.printStackTrace();
                            }
                        }
                        return stringBuffer.toString();
                    } catch (Throwable th) {
                        th = th;
                        if (bufferedReader != null) {
                            try {
                                bufferedReader.close();
                            } catch (IOException e3) {
                                e3.printStackTrace();
                            }
                        }
                        throw th;
                    }
                }
                bufferedReader.close();
                String stringBuffer2 = stringBuffer.toString();
                try {
                    bufferedReader.close();
                } catch (IOException e4) {
                    e4.printStackTrace();
                }
                return stringBuffer2;
            } catch (Throwable th2) {
                th = th2;
                bufferedReader = bufferedReader2;
            }
        } catch (IOException e5) {
            e = e5;
        }
    }
}
